Such a drug delivery device may comprise a small sized electrical motor, e.g. stepper motor, of which the action is controlled by an on-board microprocessor. The stepper motor moves the piston forward against the wall, e.g. pushed by a screw rod mechanism. The piston is moved in a controlled way as far as speed and stroke are considered. The piston pushes the flexible wall into the drug reservoir. As a result, the volume of the drug reservoir decreases and the pressure inside the drug reservoir increases. The increasing pressure causes an amount of the drug to be pushed out of the dispensing hole. While the piston pushes the flexible wall into the drug reservoir, it takes a shape that corresponds to minimum surface energy. Such shapes usually are irregular, resulting in a smaller usable drug reservoir volume and a higher resistance for the piston to move forward. When the drug reservoir becomes emptier, the flexible wall starts to fold until the piston can no longer overcome resistance from the folds and the drug viscosity and stops dispensing. When the piston stops dispensing, drugs stay behind in the folds. Consequently, it is not possible to fully empty the drug reservoir. Additionally, there is a problem of the piston sliding along the folded flexible wall surface without causing any drug to be pushed out of the dispensing hole because the piston mechanism cannot be effective.